package com.yztc.orangeentertainment.http;

//import com.yztc.orangeentertainment.config.UrlConfig;


public class HttpHelper {

    private static volatile HttpHelper singleton;

    private HttpHelper() {
    }

    public static HttpHelper getInstance() {
        if (singleton == null) {
            synchronized (HttpHelper.class) {
                if (singleton == null) {
                    singleton = new HttpHelper();
                }
            }
        }
        return singleton;
    }

//
//    public void getTop(Map<String, String> params, final OnLoadTopListener loadTopListener) {
////        getRetrofitService()
////                .getStarBeanAll(UrlConfig.Path.URL_SUBSCRIBE,params)
////                .enqueue(new Callback<List<StarBean>>() {
////                    @Override
////                    public void onResponse(Call<List<StarBean>> call, Response<List<StarBean>> response) {
////                        if (response.isSuccessful()){
////                            List<StarBean> list=response.body();
////
////                            loadTopListener.onSuccess(list);
////                        }
////                    }
////
////                    @Override
////                    public void onFailure(Call<List<StarBean>> call, Throwable t) {
////                        loadTopListener.onFailure((Exception) t);
////                        Log.i("tag","wrong");
////                    }
////                });
//    }
//
//    private RetrofitService getRetrofitService() {
//        return getRetrofit().create(RetrofitService.class);
//    }
//
//    @NonNull
//    private Retrofit getRetrofit() {
//        return new Retrofit
//                .Builder()
//                //配置基础的url
//                .baseUrl(UrlConfig.Path.BASE_URL)
//                //配置提交或者返回的参数的造型方式为gson
//                .addConverterFactory(GsonConverterFactory.create(new GsonBuilder().serializeNulls().create()))
//                //返回值可以使用Obserable
//                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                //使用https时需要配置
//                .client(new OkHttpClient())
//                .build();
//
//    }

}